
# def on_message(ws, message):
#     print(ws)
#     print(message)


# def on_error(ws, error):
#     print(ws)
#     print(error)


# def on_close(ws):
#     print(ws)
#     print("### closed ###")


# def sendmsg(msg):
#     global ws
#     ws.send(msg)


# def close():
#     global ws
#     ws.close()

# 长连接方式
# websocket.enableTrace(True)
# ws = websocket.WebSocketApp("ws://127.0.0.1:12345/echo",
#                             on_message=on_message,
#                             on_error=on_error,
#                             on_close=on_close)

# ws.run_forever()
